package com.ldc.commonres.common

import androidx.viewbinding.ViewBinding
import com.ldc.commonlibs.common.ViewModelBase


/**
 *
 *author DELL
 *dateTime 2021/12/13-14:31
 */
abstract class VBMActivity<VB : ViewBinding, VM : ViewModelBase> : VBActivity<VB>() {
    open var viewModel: VM? = null

    override fun loadViewBinding(): VB {
        val vb: VB = super.loadViewBinding()
        viewModel = loadViewModel()
        return vb
    }

    open fun loadViewModel(): VM = createViewModel()

    protected abstract fun createViewModel(): VM

}
